+2003-09-01 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkuimanager.[ch] (gtk_ui_manager_ensure_update): Make
+ this public again, since it's occasionally useful. (#121128,
+ Marco Pesenti Gritti)
+
+ * gtk/gtkaction.c: Add an "is_important" property and propagate
+ it to toolitem proxies. (#121058, Marco Pesenti Gritti)
+
Mon Sep 1 00:32:30 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* tests/testtoolbar.c (main): connect to "delete_event" so the
+2003-09-01 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkuimanager.[ch] (gtk_ui_manager_ensure_update): Make
+ this public again, since it's occasionally useful. (#121128,
+ Marco Pesenti Gritti)
+
+ * gtk/gtkaction.c: Add an "is_important" property and propagate
+ it to toolitem proxies. (#121058, Marco Pesenti Gritti)
+
Mon Sep 1 00:32:30 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* tests/testtoolbar.c (main): connect to "delete_event" so the
+2003-09-01 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkuimanager.[ch] (gtk_ui_manager_ensure_update): Make
+ this public again, since it's occasionally useful. (#121128,
+ Marco Pesenti Gritti)
+
+ * gtk/gtkaction.c: Add an "is_important" property and propagate
+ it to toolitem proxies. (#121058, Marco Pesenti Gritti)
+
Mon Sep 1 00:32:30 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* tests/testtoolbar.c (main): connect to "delete_event" so the
+2003-09-01 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkuimanager.[ch] (gtk_ui_manager_ensure_update): Make
+ this public again, since it's occasionally useful. (#121128,
+ Marco Pesenti Gritti)
+
+ * gtk/gtkaction.c: Add an "is_important" property and propagate
+ it to toolitem proxies. (#121058, Marco Pesenti Gritti)
+
Mon Sep 1 00:32:30 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* tests/testtoolbar.c (main): connect to "delete_event" so the
+2003-09-01 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkuimanager.[ch] (gtk_ui_manager_ensure_update): Make
+ this public again, since it's occasionally useful. (#121128,
+ Marco Pesenti Gritti)
+
+ * gtk/gtkaction.c: Add an "is_important" property and propagate
+ it to toolitem proxies. (#121058, Marco Pesenti Gritti)
+
Mon Sep 1 00:32:30 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* tests/testtoolbar.c (main): connect to "delete_event" so the
+2003-09-01 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtk-sections.txt: Add gtk_ui_manager_ensure_update.
+
2003-08-31 Matthias Clasen <maclas@gmx.de>
* gtk/Makefile.am (IGNORE_HFILES): Add gtktoggleactionprivate.h
gtk_ui_manager_add_ui_from_file
gtk_ui_manager_remove_ui
gtk_ui_manager_get_ui
+gtk_ui_manager_ensure_update
<SUBSECTION Standard>
GTK_TYPE_UI_MANAGER
GTK_UI_MANAGER
gchar *tooltip;
gchar *stock_id; /* icon */
- guint sensitive : 1;
- guint visible : 1;
- guint label_set : 1; /* these two used so we can set label */
+ guint sensitive : 1;
+ guint visible : 1;
+ guint label_set : 1; /* these two used so we can set label */
guint short_label_set : 1; /* based on stock id */
+ guint is_important : 1;
/* accelerator */
GQuark accel_quark;
PROP_SHORT_LABEL,
PROP_TOOLTIP,
PROP_STOCK_ID,
+ PROP_IS_IMPORTANT,
PROP_SENSITIVE,
PROP_VISIBLE,
};
_("The stock icon displayed in widgets representing this action."),
NULL,
G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_IS_IMPORTANT,
+ g_param_spec_boolean ("is_important",
+ _("Is important"),
+ _("Whether the action is considered important. When TRUE, toolitem proxies for this action show text in GTK_TOOLBAR_BOTH_HORIZ mode"),
+ FALSE,
+ G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_SENSITIVE,
g_param_spec_boolean ("sensitive",
_("Whether the action is enabled."),
TRUE,
G_PARAM_READWRITE));
-
g_object_class_install_property (gobject_class,
PROP_VISIBLE,
g_param_spec_boolean ("visible",
TRUE,
G_PARAM_READWRITE));
+
/**
* GtkAction::activate:
* @action: the #GtkAction
action->private_data->short_label = NULL;
action->private_data->tooltip = NULL;
action->private_data->stock_id = NULL;
+ action->private_data->is_important = FALSE;
action->private_data->sensitive = TRUE;
action->private_data->visible = TRUE;
g_object_notify (object, "short_label");
}
break;
+ case PROP_IS_IMPORTANT:
+ action->private_data->is_important = g_value_get_boolean (value);
+ break;
case PROP_SENSITIVE:
action->private_data->sensitive = g_value_get_boolean (value);
break;
case PROP_STOCK_ID:
g_value_set_string (value, action->private_data->stock_id);
break;
+ case PROP_IS_IMPORTANT:
+ g_value_set_boolean (value, action->private_data->is_important);
+ break;
case PROP_SENSITIVE:
g_value_set_boolean (value, action->private_data->sensitive);
break;
{
/* toolbar button specific synchronisers ... */
- /* synchronise the label */
g_object_set (G_OBJECT (proxy),
"label", action->private_data->short_label,
"use_underline", TRUE,
+ "stock_id", action->private_data->stock_id,
+ "is_important", action->private_data->is_important,
NULL);
g_signal_connect_object (action, "notify::short_label",
G_CALLBACK (gtk_action_sync_short_label),
- proxy, 0);
-
- g_object_set (G_OBJECT (proxy), "stock_id", action->private_data->stock_id, NULL);
+ proxy, 0);
g_signal_connect_object (action, "notify::stock_id",
- G_CALLBACK (gtk_action_sync_property), proxy, 0);
+ G_CALLBACK (gtk_action_sync_property),
+ proxy, 0);
+ g_signal_connect_object (action, "notify::is_important",
+ G_CALLBACK (gtk_action_sync_property),
+ proxy, 0);
g_signal_connect_object (proxy, "create_menu_proxy",
G_CALLBACK (gtk_action_create_menu_proxy),
GQuark action_quark);
static void gtk_ui_manager_node_remove_ui_reference (GtkUIManagerNode *node,
guint merge_id);
-static void gtk_ui_manager_ensure_update (GtkUIManager *self);
enum
self->private_data->update_tag = g_idle_add ((GSourceFunc)do_updates, self);
}
-static void
+
+/**
+ * gtk_ui_manager_ensure_update:
+ * @self: a #GtkUIManager
+ *
+ * Makes sure that all pending updates to the UI have been completed.
+ *
+ * This may occasionally be necessary, since #GtkUIManager updates the
+ * UI in an idle function. A typical example where this function is
+ * useful is to enforce that the menubar and toolbar have been added to
+ * the main window before showing it:
+ * <informalexample>
+ * <programlisting>
+ * gtk_container_add (GTK_CONTAINER (window), vbox);
+ * g_signal_connect (merge, "add_widget",
+ * G_CALLBACK (add_widget), vbox);
+ * gtk_ui_manager_add_ui_from_file (merge, "my-menus");
+ * gtk_ui_manager_add_ui_from_file (merge, "my-toolbars");
+ * gtk_ui_manager_ensure_update (merge);
+ * gtk_widget_show (window);
+ * </programlisting>
+ * </informalexample>
+ *
+ * Since: 2.4
+ **/
+void
gtk_ui_manager_ensure_update (GtkUIManager *self)
{
if (self->private_data->update_tag != 0)
gboolean add_tearoffs);
gboolean gtk_ui_manager_get_add_tearoffs (GtkUIManager *self);
-/* these two functions will dirty all merge nodes, as they may need to
- * be connected up to different actions */
void gtk_ui_manager_insert_action_group (GtkUIManager *self,
GtkActionGroup *action_group,
gint pos);
gchar *gtk_ui_manager_get_ui (GtkUIManager *self);
+void gtk_ui_manager_ensure_update (GtkUIManager *self);
+
#endif /* __GTK_UI_MANAGER_H__ */